<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>layout 管理系统大布局 - Layui</title>
  
  <!--导入核心文件-->
  		<script src="../bootstrap3/js/holder.js"></script>
  		<link href="../bootstrap3/css/bootstrap.css" rel="stylesheet" type="text/css">
  		<script src="../bootstrap3/jquery-1.9.1.min.js"></script>
  		<script src="../bootstrap3/js/bootstrap.js"></script>
  		<!-- 字体图标 -->
  		<link rel="stylesheet" href="../bootstrap3/font-awesome-4.7.0/css/font-awesome.css" />
  		<link rel="stylesheet" type="text/css" href="../css/layout.css" />
  		<link rel="stylesheet" type="text/css" href="../css/top.css" />
  		<link rel="stylesheet" type="text/css" href="../css/footer.css" />
  		<script src="../js/adddel.js" type="text/javascript" charset="utf-8"></script>
  
  <link rel="stylesheet" href="../layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo layui-hide-xs layui-bg-black">二手书平台</div>
    <!-- 头部区域（可配合layui 已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
      <!-- 移动端显示 -->
      <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
        <i class="layui-icon layui-icon-spread-left"></i>
      </li>
      
      <li class="layui-nav-item layui-hide-xs"><a href="">nav 1</a></li>
      <li class="layui-nav-item layui-hide-xs"><a href="">nav 2</a></li>
      <li class="layui-nav-item layui-hide-xs"><a href="">nav 3</a></li>
      <li class="layui-nav-item">
        <a href="javascript:;">nav groups</a>
        <dl class="layui-nav-child">
          <dd><a href="">menu 11</a></dd>
          <dd><a href="">menu 22</a></dd>
          <dd><a href="">menu 33</a></dd>
        </dl>
      </li>
    </ul>
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item layui-hide layui-show-md-inline-block">
        <a href="javascript:;">
          <img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
          靓仔
        </a>
        <dl class="layui-nav-child">
          <dd><a href="">注册</a></dd>
          <dd><a href="">登录</a></dd>
          <dd><a href="">注销</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
        <a href="javascript:;">
          <i class="layui-icon layui-icon-more-vertical"></i>
        </a>
      </li>
    </ul>
  </div>
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree" lay-filter="test">
        <li class="layui-nav-item">
          <a class="" href="javascript:;">menu group 1</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">menu 1</a></dd>
            <dd><a href="javascript:;">menu 2</a></dd>
            <dd><a href="javascript:;">menu 3</a></dd>
            <dd><a href="">the links</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;">menu group 2</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">list 1</a></dd>
            <dd><a href="javascript:;">list 2</a></dd>
            <dd><a href="">超链接</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
			<a href="javascript:;">click menu item</a>
			<dl class="layui-nav-child">
			  <dd><a href="javascript:;">list 1</a></dd>
			  <dd><a href="javascript:;">list 2</a></dd>
			  <dd><a href="">超链接</a></dd>
			</dl>
		</li>
        <li class="layui-nav-item layui-nav-itemed">
			<a>信息管理</a>
			<dl class="layui-nav-child" lay-filter="navchange">
			  <dd id="userInfo"><a>个人资料</a></dd>
			  <dd id="uploadAvartar"><a>头像上传</a></dd>
			  <dd id="updatePwd"><a>密码修改</a></dd>
			  <dd id="address"><a>收货管理</a></dd>
			</dl>
		</li>
      </ul>
    </div>
  </div>
  
  <div class="layui-body">
    <!-- 内容主体区域 -->
    <div style="padding: 15px;">
		
		<!-- Tabs -->
		<div class="layui-tab" lay-filter="test1">
		  <ul class="layui-tab-title">
		    <li class="layui-this" lay-id="1111" >个人资料</li>
		    <li lay-id="2222">头像上传</li>
		    <li lay-id="3333">密码修改</li>
		    <li lay-id="4444">收货管理</li>
		  </ul>
		  <div class="layui-tab-content">
		    <div class="layui-tab-item layui-show">
				<!-- 个人资料 -->
				<!-- =================================================================== -->
				<div class="panel-body">
					<!--修改资料表单开始-->
					<form  class="form-horizontal" role="form">
						<div class="form-group">
							<label class="col-md-2 control-label">用户名：</label>
							<div class="col-md-8">
								<input type="text" class="form-control"  value="孙悟空" readonly="readonly">
							</div>
						</div>
						<div class="form-group">
							<label  class="col-md-2 control-label">电话号码：</label>
							<div class="col-md-8">
								<input type="text" class="form-control"  placeholder="请输入电话号码" value="13311311313">
							</div>
						</div>
						<div class="form-group">
							<label  class="col-md-2 control-label">电子邮箱：</label>
							<div class="col-md-8">
								<input type="text" class="form-control"  placeholder="请输入电子邮箱" value="sunwk@qq.com">
							</div>
						</div>
						<div class="form-group">
							<label  class="col-md-2 control-label">性别：</label>
							<div class="col-md-8">
								<label class="radio-inline">
									<input type="radio" name="gender"  value="男" checked>男
								</label>
								<label class="radio-inline">
									<input type="radio" name="gender"  value="女">女
								</label>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
								<input type="button" class="btn btn-primary" value="修改" />
							</div>
						</div>
					</form>
				</div>				
				<!-- =================================================================== -->
			</div>
			
		    <div class="layui-tab-item">
				<!-- 头像上传 -->
				<!-- =================================================================== -->
				<div class="panel-body">
					<!--上传头像表单开始-->
					<form class="form-horizontal" role="form">
						<div class="form-group">
							<label  class="col-md-2 control-label">选择头像:</label>
							<div class="col-md-8">
								<img src="../images/user.jpg" width="70" />
								<input type="file" >
							</div>
						</div>

						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
								<input type="button" class="btn btn-primary" value="上传" />
							</div>
						</div>
					</form>
				</div>				
				<!-- =================================================================== -->
				
			</div>
			
		    <div class="layui-tab-item">
				<!-- 密码修改 -->
				<!-- =================================================================== -->
				<div class="panel-body">
					<!--修改密码表单开始-->
					<form class="form-horizontal" role="form">
						<div class="form-group">
							<label class="col-md-2 control-label">原密码：</label>
							<div class="col-md-8">
								<input type="text" class="form-control" placeholder="请输入原密码">
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-2 control-label">新密码：</label>
							<div class="col-md-8">
								<input type="text" class="form-control" placeholder="请输入新密码">
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-2 control-label">确认密码：</label>
							<div class="col-md-8">
								<input type="text" class="form-control" placeholder="请再次输入新密码">
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
								<input type="button" class="btn btn-primary" value="修改" />
							</div>
						</div>
					</form>
				</div>				
				<!-- =================================================================== -->
				
			</div>
			
		    <div class="layui-tab-item">
				<!-- 收货管理 -->
				<!-- =================================================================== -->
				<div class="panel-body">
					<!--地址显示-->
					<table class="table table-striped">
						<caption>收货地址列表</caption>
						<thead>
							<tr>
								<th>地址类型</th>
								<th>收货人姓名</th>
								<th>详细地址</th>
								<th>联系电话</th>
								<th colspan="3">操作</th>
								
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>家</td>
								<td>八戒</td>
								<td>北京市房山区高老庄3排6号</td>
								<td>1380***1234</td>
								<td><a class="btn btn-xs btn-info" ><span class="fa fa-edit"></span> 修改</a></td>
								<td><a class="btn btn-xs add-del btn-info" ><span class="fa fa-trash-o"></span> 删除</a></td>
								<td><a class="btn btn-xs add-def btn-default">设为默认</a></td>
								
							</tr>
							<tr>
								<td>公司</td>
								<td>八戒</td>
								<td>北京市海淀区中关村中路1号1001室</td>
								<td>1380***1234</td>
								<td><a class="btn btn-xs btn-info" ><span class="fa fa-edit"></span> 修改</a></td>
								<td><a class="btn btn-xs add-del btn-info" ><span class="fa fa-trash-o"></span> 删除</a></td>
								<td><a class="btn btn-xs add-def btn-default" >设为默认</a></td>
							</tr>
							<tr>
								<td>宿舍</td>
								<td>八戒</td>
								<td>北京市海淀区永丰镇30号</td>
								<td>1380***1234</td>
								<td><a class="btn btn-xs btn-info" ><span class="fa fa-edit"></span> 修改</a></td>
								<td><a class="btn btn-xs add-del btn-info" ><span class="fa fa-trash-o"></span> 删除</a></td>
								<td><a class="btn btn-xs add-def btn-default" >设为默认</a></td>
							</tr>
						</tbody>
					</table>
					<a href="addAddress.html" class="btn btn-sm btn-primary"><span class="fa fa-plus"></span>新增收货地址</a>
				</div>				
				<!-- =================================================================== -->
				
			</div>
			
		  </div>
		</div>

		
	</div>
  </div>
  
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    底部固定区域
  </div>
</div>
<script src="../layui/layui.js"></script>
<script>
//JS 
layui.use(['element', 'layer', 'util'], function(){
  var element = layui.element
  ,layer = layui.layer
  ,util = layui.util
  ,$ = layui.$;
  
    //获取hash来切换选项卡，假设当前地址的hash为lay-id对应的值
    var layid = location.hash.replace(/^#test1=/, '');
    element.tabChange('test1', layid); //假设当前地址为：http://a.com#test1=222，那么选项卡会自动切换到“发送消息”这一项
    
    //监听Tab切换，以改变地址hash值
    element.on('tab(test1)', function(){
      location.hash = 'test1='+ this.getAttribute('lay-id');
    });
	
	//点击事件，在导航栏切换tab
	$("#userInfo").click(function(){
		element.tabChange('test1', '1111');
	});
	$("#uploadAvartar").click(function(){
		element.tabChange('test1', '2222');
	});
	$("#updatePwd").click(function(){
		element.tabChange('test1', '3333');
	});
	
	$("#address").click(function(){
		element.tabChange('test1', '4444');
	});
  
  //头部事件
  util.event('lay-header-event', {
    //左侧菜单事件
    menuLeft: function(othis){
      layer.msg('展开左侧菜单的操作', {icon: 0});
    }
    ,menuRight: function(){
      layer.open({
        type: 1
        ,content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
        ,area: ['260px', '100%']
        ,offset: 'rt' //右上角
        ,anim: 5
        ,shadeClose: true
      });
    }
  });
  
  
  
});
</script>
</body>
</html>